import Rest from '@/utils/Rest'
// 平台系统自定义的接口
import http from '@/utils/http'

/**
 * 系统用户
 */
export default class SysUserRest extends Rest {
/**
   * 构造函数
   */
  constructor (subSys) {
    // 模块英文名（小写）
    let module = 'sys/user'
    super(subSys, module)
  }
  // 初始化密码
  initialize (data) {
    let _this = this
    return http({
      method: 'post',
      url: _this.getBaseURL() + `/initialize`,
      data
    })
  }
  // 获取当前角色未分配的员工
  orgUser (params) {
    let _this = this
    return http({
      method: 'get',
      url: _this.getBaseURL() + `/orgUser`,
      params
    })
  }
  // 获取当前角色未分配的员工
  orgUser1 (params) {
    let _this = this
    return http({
      method: 'get',
      url: _this.getBaseURL() + `/orgUser1`,
      params
    })
  }
  // 校验密码
  checkUserPass (data) {
    let _this = this
    return http({
      method: 'post',
      url: _this.getBaseURL() + `/checkUserPass`,
      data
    })
  }
  // 修改密码
  editPass (data) {
    let _this = this
    return http({
      method: 'post',
      url: _this.getBaseURL() + `/editPass`,
      data
    })
  }
  /**
   * params 获取登陆用户
   * @param {*} params params
   * @returns {*} returns returns
   */
  getUser () {
    return http({
      method: 'get',
      url: `/login/getUser`
    })
  }
}
